--
-- PostgreSQL database dump
--

-- Started on 2010-06-01 01:24:51

SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = off;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET escape_string_warning = off;

--
-- TOC entry 1934 (class 1262 OID 18303)
-- Name: hegeprosoft; Type: DATABASE; Schema: -; Owner: postgres
--

CREATE DATABASE hegeprosoft WITH TEMPLATE = template0 ENCODING = 'UTF8' LC_COLLATE = 'Spanish, Colombia' LC_CTYPE = 'Spanish, Colombia';


ALTER DATABASE hegeprosoft OWNER TO postgres;

\connect hegeprosoft

SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = off;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET escape_string_warning = off;

--
-- TOC entry 355 (class 2612 OID 16386)
-- Name: plpgsql; Type: PROCEDURAL LANGUAGE; Schema: -; Owner: postgres
--

CREATE PROCEDURAL LANGUAGE plpgsql;


ALTER PROCEDURAL LANGUAGE plpgsql OWNER TO postgres;

SET search_path = public, pg_catalog;

SET default_tablespace = '';

SET default_with_oids = false;

--
-- TOC entry 1543 (class 1259 OID 18307)
-- Dependencies: 3
-- Name: actividad; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE actividad (
    act_idactividad integer NOT NULL,
    act_nombreactividad character varying(30) NOT NULL,
    act_metodologia character varying(20),
    act_fase integer NOT NULL,
    act_descripcion character varying(500)
);


ALTER TABLE public.actividad OWNER TO postgres;

--
-- TOC entry 1542 (class 1259 OID 18305)
-- Dependencies: 1543 3
-- Name: actividad_act_idactividad_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE actividad_act_idactividad_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.actividad_act_idactividad_seq OWNER TO postgres;

--
-- TOC entry 1937 (class 0 OID 0)
-- Dependencies: 1542
-- Name: actividad_act_idactividad_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE actividad_act_idactividad_seq OWNED BY actividad.act_idactividad;


--
-- TOC entry 1938 (class 0 OID 0)
-- Dependencies: 1542
-- Name: actividad_act_idactividad_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('actividad_act_idactividad_seq', 5, true);


--
-- TOC entry 1545 (class 1259 OID 18318)
-- Dependencies: 3
-- Name: artefactos; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE artefactos (
    art_idartefacto integer NOT NULL,
    art_nombreartefacto character varying(20) NOT NULL,
    art_metodologia character varying(20),
    art_actividad integer NOT NULL,
    art_descripcion character varying(500)
);


ALTER TABLE public.artefactos OWNER TO postgres;

--
-- TOC entry 1544 (class 1259 OID 18316)
-- Dependencies: 3 1545
-- Name: artefactos_art_idartefacto_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE artefactos_art_idartefacto_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.artefactos_art_idartefacto_seq OWNER TO postgres;

--
-- TOC entry 1939 (class 0 OID 0)
-- Dependencies: 1544
-- Name: artefactos_art_idartefacto_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE artefactos_art_idartefacto_seq OWNED BY artefactos.art_idartefacto;


--
-- TOC entry 1940 (class 0 OID 0)
-- Dependencies: 1544
-- Name: artefactos_art_idartefacto_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('artefactos_art_idartefacto_seq', 6, true);


--
-- TOC entry 1547 (class 1259 OID 18329)
-- Dependencies: 3
-- Name: configuracioncurso; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE configuracioncursoFase (
    cfc_idconfiguracioncurso integer NOT NULL,
    cfc_curso character varying(12) NOT NULL,
    cfc_fase integer NOT NULL,
    cfc_roles character varying(50),
    cfc_fechaentrega timestamp without time zone NOT NULL,
);
CREATE TABLE configuracioncursoArtecfacto (
    cfc_idconfiguracioncurso integer NOT NULL,
    cfc_curso character varying(12) NOT NULL,
        cfc_artefacto integer NOT NULL,
    cfc_roles character varying(50),
    cfc_fechaentrega timestamp without time zone NOT NULL,


    cfc_actividad integer NOT NULL,
    
);
CREATE TABLE configuracioncursoActividad (
    cfc_idconfiguracioncurso integer NOT NULL,
    cfc_curso character varying(12) NOT NULL,
    cfc_actividad integer NOT NULL,
    cfc_roles character varying(50),
    cfc_fechaentrega timestamp without time zone NOT NULL,
   
);


ALTER TABLE public.configuracioncurso OWNER TO postgres;

--
-- TOC entry 1546 (class 1259 OID 18327)
-- Dependencies: 1547 3
-- Name: configuracioncurso_cfc_idconfiguracioncurso_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE configuracioncurso_cfc_idconfiguracioncurso_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.configuracioncurso_cfc_idconfiguracioncurso_seq OWNER TO postgres;

--
-- TOC entry 1941 (class 0 OID 0)
-- Dependencies: 1546
-- Name: configuracioncurso_cfc_idconfiguracioncurso_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE configuracioncurso_cfc_idconfiguracioncurso_seq OWNED BY configuracioncurso.cfc_idconfiguracioncurso;


--
-- TOC entry 1942 (class 0 OID 0)
-- Dependencies: 1546
-- Name: configuracioncurso_cfc_idconfiguracioncurso_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('configuracioncurso_cfc_idconfiguracioncurso_seq', 1, false);


--
-- TOC entry 1548 (class 1259 OID 18335)
-- Dependencies: 3
-- Name: curso; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE curso (
    cur_materia character varying(12) NOT NULL,
    cur_metodologia character varying(30),
    cur_idcurso character varying(12) NOT NULL
);


ALTER TABLE public.curso OWNER TO postgres;

--
-- TOC entry 1549 (class 1259 OID 18340)
-- Dependencies: 3
-- Name: estudiante; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE estudiante (
    est_codigoestudiante character varying(10) NOT NULL,
    est_nombreestudiante character varying(30),
    est_apellidoestudiante character varying(30),
    est_grupotrabajo integer NOT NULL,
    est_loginusuario character varying(20) NOT NULL,
    est_cursoestudiante character varying(12) NOT NULL
);


ALTER TABLE public.estudiante OWNER TO postgres;

--
-- TOC entry 1551 (class 1259 OID 18348)
-- Dependencies: 3
-- Name: fase; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE fase (
    fas_idfase integer NOT NULL,
    fas_nombrefase character varying(20) NOT NULL,
    fas_metodologia character varying(30),
    fas_descripcion character varying(500)
);


ALTER TABLE public.fase OWNER TO postgres;

--
-- TOC entry 1550 (class 1259 OID 18346)
-- Dependencies: 3 1551
-- Name: fase_fas_idfase_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE fase_fas_idfase_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.fase_fas_idfase_seq OWNER TO postgres;

--
-- TOC entry 1943 (class 0 OID 0)
-- Dependencies: 1550
-- Name: fase_fas_idfase_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE fase_fas_idfase_seq OWNED BY fase.fas_idfase;


--
-- TOC entry 1944 (class 0 OID 0)
-- Dependencies: 1550
-- Name: fase_fas_idfase_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('fase_fas_idfase_seq', 4, true);


--
-- TOC entry 1553 (class 1259 OID 18359)
-- Dependencies: 3
-- Name: grupotrabajo; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE grupotrabajo (
    grt_idgrupotrabajo integer NOT NULL,
    grt_nombregrupotrabajo character varying(20) NOT NULL,
    grt_curso character varying(10) NOT NULL,
    grt_notadefinitiva integer
);


ALTER TABLE public.grupotrabajo OWNER TO postgres;

--
-- TOC entry 1552 (class 1259 OID 18357)
-- Dependencies: 3 1553
-- Name: grupotrabajo_grt_idgrupotrabajo_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE grupotrabajo_grt_idgrupotrabajo_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.grupotrabajo_grt_idgrupotrabajo_seq OWNER TO postgres;

--
-- TOC entry 1945 (class 0 OID 0)
-- Dependencies: 1552
-- Name: grupotrabajo_grt_idgrupotrabajo_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE grupotrabajo_grt_idgrupotrabajo_seq OWNED BY grupotrabajo.grt_idgrupotrabajo;


--
-- TOC entry 1946 (class 0 OID 0)
-- Dependencies: 1552
-- Name: grupotrabajo_grt_idgrupotrabajo_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('grupotrabajo_grt_idgrupotrabajo_seq', 6, true);


--
-- TOC entry 1555 (class 1259 OID 18367)
-- Dependencies: 3
-- Name: material; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE material (
    idmaterial integer NOT NULL,
    mat_nombrematerial character varying(255) NOT NULL,
    mat_ruta character varying(90) NOT NULL,
    mat_descripcionmaterial character varying(500),
    mat_fasematerial integer,
    mat_artefactomaterial integer,
    mat_actividad integer
);


ALTER TABLE public.material OWNER TO postgres;

--
-- TOC entry 1554 (class 1259 OID 18365)
-- Dependencies: 3 1555
-- Name: material_idmaterial_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE material_idmaterial_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.material_idmaterial_seq OWNER TO postgres;

--
-- TOC entry 1947 (class 0 OID 0)
-- Dependencies: 1554
-- Name: material_idmaterial_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE material_idmaterial_seq OWNED BY material.idmaterial;


--
-- TOC entry 1948 (class 0 OID 0)
-- Dependencies: 1554
-- Name: material_idmaterial_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('material_idmaterial_seq', 9, true);


--
-- TOC entry 1570 (class 1259 OID 18548)
-- Dependencies: 3
-- Name: metodologia; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE metodologia (
    met_id integer NOT NULL,
    met_nombre character varying(50),
    met_descripcion character varying(400)
);


ALTER TABLE public.metodologia OWNER TO postgres;

--
-- TOC entry 1569 (class 1259 OID 18546)
-- Dependencies: 3 1570
-- Name: metodologia_met_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE metodologia_met_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.metodologia_met_id_seq OWNER TO postgres;

--
-- TOC entry 1949 (class 0 OID 0)
-- Dependencies: 1569
-- Name: metodologia_met_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE metodologia_met_id_seq OWNED BY metodologia.met_id;


--
-- TOC entry 1950 (class 0 OID 0)
-- Dependencies: 1569
-- Name: metodologia_met_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('metodologia_met_id_seq', 1, true);


--
-- TOC entry 1557 (class 1259 OID 18378)
-- Dependencies: 3
-- Name: modulo; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE modulo (
    mod_idmodulo integer NOT NULL,
    mod_nombremodulo character varying(20) NOT NULL,
    mod_rutamodulo character varying(200) NOT NULL,
    mod_visible character varying(20),
    mod_padre character varying(50),
    mod_numero character varying(100),
    mod_rol character varying(20)
);


ALTER TABLE public.modulo OWNER TO postgres;

--
-- TOC entry 1556 (class 1259 OID 18376)
-- Dependencies: 3 1557
-- Name: modulo_mod_idmodulo_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE modulo_mod_idmodulo_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.modulo_mod_idmodulo_seq OWNER TO postgres;

--
-- TOC entry 1951 (class 0 OID 0)
-- Dependencies: 1556
-- Name: modulo_mod_idmodulo_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE modulo_mod_idmodulo_seq OWNED BY modulo.mod_idmodulo;


--
-- TOC entry 1952 (class 0 OID 0)
-- Dependencies: 1556
-- Name: modulo_mod_idmodulo_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('modulo_mod_idmodulo_seq', 1, false);


--
-- TOC entry 1559 (class 1259 OID 18386)
-- Dependencies: 3
-- Name: permiso; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE permiso (
    pem_idpermiso integer NOT NULL,
    pem_usuario character varying(255) NOT NULL,
    pem_modulo integer NOT NULL,
    mod_tipo character varying(10)
);


ALTER TABLE public.permiso OWNER TO postgres;

--
-- TOC entry 1558 (class 1259 OID 18384)
-- Dependencies: 1559 3
-- Name: permiso_pem_idpermiso_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE permiso_pem_idpermiso_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.permiso_pem_idpermiso_seq OWNER TO postgres;

--
-- TOC entry 1953 (class 0 OID 0)
-- Dependencies: 1558
-- Name: permiso_pem_idpermiso_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE permiso_pem_idpermiso_seq OWNED BY permiso.pem_idpermiso;


--
-- TOC entry 1954 (class 0 OID 0)
-- Dependencies: 1558
-- Name: permiso_pem_idpermiso_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('permiso_pem_idpermiso_seq', 1, false);


--
-- TOC entry 1560 (class 1259 OID 18392)
-- Dependencies: 3
-- Name: profesor; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE profesor (
    prf_cedulaprofesor character varying(12) NOT NULL,
    prf_nombreprofesor character varying(30),
    prf_apellidoprofesor character varying(30),
    prf_loginusuario character varying(10) NOT NULL,
    prf_cursoprofesor character varying(10) NOT NULL
);


ALTER TABLE public.profesor OWNER TO postgres;

--
-- TOC entry 1562 (class 1259 OID 18399)
-- Dependencies: 3
-- Name: reporteentregas; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE reporteentregas (
    rpe_idreporte integer NOT NULL,
    rpe_grupotrabajo integer NOT NULL,
    rpe_actividad integer NOT NULL,
    rpe_fecha timestamp without time zone,
    rpe_observcionreporteentrega character varying(500)
);


ALTER TABLE public.reporteentregas OWNER TO postgres;

--
-- TOC entry 1561 (class 1259 OID 18397)
-- Dependencies: 3 1562
-- Name: reporteentregas_rpe_idreporte_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE reporteentregas_rpe_idreporte_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.reporteentregas_rpe_idreporte_seq OWNER TO postgres;

--
-- TOC entry 1955 (class 0 OID 0)
-- Dependencies: 1561
-- Name: reporteentregas_rpe_idreporte_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE reporteentregas_rpe_idreporte_seq OWNED BY reporteentregas.rpe_idreporte;


--
-- TOC entry 1956 (class 0 OID 0)
-- Dependencies: 1561
-- Name: reporteentregas_rpe_idreporte_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('reporteentregas_rpe_idreporte_seq', 1, false);


--
-- TOC entry 1563 (class 1259 OID 18408)
-- Dependencies: 3
-- Name: reportenotas; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE reportenotas (
    rpn_idreportenotas integer NOT NULL,
    rpn_actividad integer NOT NULL,
    rpn_profesor character varying(12) NOT NULL,
    rpn_nota character varying(255),
    rpn_observaciones character varying(500),
    rpn_grupotrabajo integer NOT NULL,
    reporteentrega integer NOT NULL
);


ALTER TABLE public.reportenotas OWNER TO postgres;

--
-- TOC entry 1565 (class 1259 OID 18418)
-- Dependencies: 3
-- Name: roles; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE roles (
    rol_idroles integer NOT NULL,
    rol_nombreroles character varying(20) NOT NULL,
    rol_actividadroles character varying(20),
    rol_descripcionroles character varying(500)
);


ALTER TABLE public.roles OWNER TO postgres;

--
-- TOC entry 1564 (class 1259 OID 18416)
-- Dependencies: 1565 3
-- Name: roles_rol_idroles_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE roles_rol_idroles_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.roles_rol_idroles_seq OWNER TO postgres;

--
-- TOC entry 1957 (class 0 OID 0)
-- Dependencies: 1564
-- Name: roles_rol_idroles_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE roles_rol_idroles_seq OWNED BY roles.rol_idroles;


--
-- TOC entry 1958 (class 0 OID 0)
-- Dependencies: 1564
-- Name: roles_rol_idroles_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('roles_rol_idroles_seq', 1, false);


--
-- TOC entry 1567 (class 1259 OID 18429)
-- Dependencies: 3
-- Name: tipousuario; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipousuario (
    tpu_id integer NOT NULL,
    tpu_nombre character varying(20) NOT NULL
);


ALTER TABLE public.tipousuario OWNER TO postgres;

--
-- TOC entry 1566 (class 1259 OID 18427)
-- Dependencies: 3 1567
-- Name: tipousuario_tpu_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tipousuario_tpu_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.tipousuario_tpu_id_seq OWNER TO postgres;

--
-- TOC entry 1959 (class 0 OID 0)
-- Dependencies: 1566
-- Name: tipousuario_tpu_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tipousuario_tpu_id_seq OWNED BY tipousuario.tpu_id;


--
-- TOC entry 1960 (class 0 OID 0)
-- Dependencies: 1566
-- Name: tipousuario_tpu_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('tipousuario_tpu_id_seq', 1, false);


--
-- TOC entry 1568 (class 1259 OID 18435)
-- Dependencies: 3
-- Name: usuario; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE usuario (
    usu_loginusuario character varying(10) NOT NULL,
    usu_contrasenausuario character varying(20) NOT NULL,
    usu_tipousuario character varying(15) NOT NULL
);


ALTER TABLE public.usuario OWNER TO postgres;

--
-- TOC entry 1848 (class 2604 OID 18310)
-- Dependencies: 1543 1542 1543
-- Name: act_idactividad; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE actividad ALTER COLUMN act_idactividad SET DEFAULT nextval('actividad_act_idactividad_seq'::regclass);


--
-- TOC entry 1849 (class 2604 OID 18321)
-- Dependencies: 1545 1544 1545
-- Name: art_idartefacto; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE artefactos ALTER COLUMN art_idartefacto SET DEFAULT nextval('artefactos_art_idartefacto_seq'::regclass);


--
-- TOC entry 1850 (class 2604 OID 18332)
-- Dependencies: 1546 1547 1547
-- Name: cfc_idconfiguracioncurso; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE configuracioncurso ALTER COLUMN cfc_idconfiguracioncurso SET DEFAULT nextval('configuracioncurso_cfc_idconfiguracioncurso_seq'::regclass);


--
-- TOC entry 1851 (class 2604 OID 18351)
-- Dependencies: 1550 1551 1551
-- Name: fas_idfase; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE fase ALTER COLUMN fas_idfase SET DEFAULT nextval('fase_fas_idfase_seq'::regclass);


--
-- TOC entry 1852 (class 2604 OID 18362)
-- Dependencies: 1553 1552 1553
-- Name: grt_idgrupotrabajo; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE grupotrabajo ALTER COLUMN grt_idgrupotrabajo SET DEFAULT nextval('grupotrabajo_grt_idgrupotrabajo_seq'::regclass);


--
-- TOC entry 1853 (class 2604 OID 18370)
-- Dependencies: 1555 1554 1555
-- Name: idmaterial; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE material ALTER COLUMN idmaterial SET DEFAULT nextval('material_idmaterial_seq'::regclass);


--
-- TOC entry 1859 (class 2604 OID 18551)
-- Dependencies: 1570 1569 1570
-- Name: met_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE metodologia ALTER COLUMN met_id SET DEFAULT nextval('metodologia_met_id_seq'::regclass);


--
-- TOC entry 1854 (class 2604 OID 18381)
-- Dependencies: 1557 1556 1557
-- Name: mod_idmodulo; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE modulo ALTER COLUMN mod_idmodulo SET DEFAULT nextval('modulo_mod_idmodulo_seq'::regclass);


--
-- TOC entry 1855 (class 2604 OID 18389)
-- Dependencies: 1558 1559 1559
-- Name: pem_idpermiso; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE permiso ALTER COLUMN pem_idpermiso SET DEFAULT nextval('permiso_pem_idpermiso_seq'::regclass);


--
-- TOC entry 1856 (class 2604 OID 18402)
-- Dependencies: 1562 1561 1562
-- Name: rpe_idreporte; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE reporteentregas ALTER COLUMN rpe_idreporte SET DEFAULT nextval('reporteentregas_rpe_idreporte_seq'::regclass);


--
-- TOC entry 1857 (class 2604 OID 18421)
-- Dependencies: 1564 1565 1565
-- Name: rol_idroles; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE roles ALTER COLUMN rol_idroles SET DEFAULT nextval('roles_rol_idroles_seq'::regclass);


--
-- TOC entry 1858 (class 2604 OID 18432)
-- Dependencies: 1567 1566 1567
-- Name: tpu_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE tipousuario ALTER COLUMN tpu_id SET DEFAULT nextval('tipousuario_tpu_id_seq'::regclass);


--
-- TOC entry 1915 (class 0 OID 18307)
-- Dependencies: 1543
-- Data for Name: actividad; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO actividad (act_idactividad, act_nombreactividad, act_metodologia, act_fase, act_descripcion) VALUES (2, 'Modelo del Negocio', 'RUP', 1, 'actividad fase inicio');
INSERT INTO actividad (act_idactividad, act_nombreactividad, act_metodologia, act_fase, act_descripcion) VALUES (3, 'Requerimiento', 'RUP', 1, 'Activida Fase Inicio');
INSERT INTO actividad (act_idactividad, act_nombreactividad, act_metodologia, act_fase, act_descripcion) VALUES (4, 'Planificacion', ' XP', 3, 'Actividad Fase Exploracion');
INSERT INTO actividad (act_idactividad, act_nombreactividad, act_metodologia, act_fase, act_descripcion) VALUES (5, 'Diseño', 'XP', 4, 'Actividad Fase Planificacion');


--
-- TOC entry 1916 (class 0 OID 18318)
-- Dependencies: 1545
-- Data for Name: artefactos; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO artefactos (art_idartefacto, art_nombreartefacto, art_metodologia, art_actividad, art_descripcion) VALUES (1, 'Casos de USo', 'RUP', 2, 'act');
INSERT INTO artefactos (art_idartefacto, art_nombreartefacto, art_metodologia, art_actividad, art_descripcion) VALUES (2, 'Historias de Usuario', 'XP', 4, 'act2');


--
-- TOC entry 1917 (class 0 OID 18329)
-- Dependencies: 1547
-- Data for Name: configuracioncurso; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- TOC entry 1918 (class 0 OID 18335)
-- Dependencies: 1548
-- Data for Name: curso; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO curso (cur_materia, cur_metodologia, cur_idcurso) VALUES ('Desarrollo I', 'XP', '750805M');
INSERT INTO curso (cur_materia, cur_metodologia, cur_idcurso) VALUES ('DesarrolloII', 'RUP', '750806M');


--
-- TOC entry 1919 (class 0 OID 18340)
-- Dependencies: 1549
-- Data for Name: estudiante; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO estudiante (est_codigoestudiante, est_nombreestudiante, est_apellidoestudiante, est_grupotrabajo, est_loginusuario, est_cursoestudiante) VALUES ('124', 's', 's', 1, 'asf', '750806M');
INSERT INTO estudiante (est_codigoestudiante, est_nombreestudiante, est_apellidoestudiante, est_grupotrabajo, est_loginusuario, est_cursoestudiante) VALUES ('12356s', 'as', 'as', 1, 'as', '750805M');
INSERT INTO estudiante (est_codigoestudiante, est_nombreestudiante, est_apellidoestudiante, est_grupotrabajo, est_loginusuario, est_cursoestudiante) VALUES ('555555', 'as', 'as', 1, 'as', '750805M');
INSERT INTO estudiante (est_codigoestudiante, est_nombreestudiante, est_apellidoestudiante, est_grupotrabajo, est_loginusuario, est_cursoestudiante) VALUES ('987', 's', 's', 1, 'as', '750805M');
INSERT INTO estudiante (est_codigoestudiante, est_nombreestudiante, est_apellidoestudiante, est_grupotrabajo, est_loginusuario, est_cursoestudiante) VALUES ('w9872', 's', 's', 1, 'wwwasw', '750805M');
INSERT INTO estudiante (est_codigoestudiante, est_nombreestudiante, est_apellidoestudiante, est_grupotrabajo, est_loginusuario, est_cursoestudiante) VALUES ('a2345sd', 's', 's', 1, 'asdf12', '750805M');
INSERT INTO estudiante (est_codigoestudiante, est_nombreestudiante, est_apellidoestudiante, est_grupotrabajo, est_loginusuario, est_cursoestudiante) VALUES ('w', 'w', 'w', 1, 'w', '750805M');
INSERT INTO estudiante (est_codigoestudiante, est_nombreestudiante, est_apellidoestudiante, est_grupotrabajo, est_loginusuario, est_cursoestudiante) VALUES ('12ert', 'w', 'w', 1, 'asdfgh', '750805M');
INSERT INTO estudiante (est_codigoestudiante, est_nombreestudiante, est_apellidoestudiante, est_grupotrabajo, est_loginusuario, est_cursoestudiante) VALUES ('2fafasgd', 's', 's', 1, '12789', '750805M');
INSERT INTO estudiante (est_codigoestudiante, est_nombreestudiante, est_apellidoestudiante, est_grupotrabajo, est_loginusuario, est_cursoestudiante) VALUES ('1f', 's', 's', 1, '1f', '750805M');


--
-- TOC entry 1920 (class 0 OID 18348)
-- Dependencies: 1551
-- Data for Name: fase; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO fase (fas_idfase, fas_nombrefase, fas_metodologia, fas_descripcion) VALUES (1, 'Inicio', 'RUP', 'fase de RUP');
INSERT INTO fase (fas_idfase, fas_nombrefase, fas_metodologia, fas_descripcion) VALUES (2, 'Elaboracion', 'RUP', 'fase RUP');
INSERT INTO fase (fas_idfase, fas_nombrefase, fas_metodologia, fas_descripcion) VALUES (3, 'Exploracion', 'XP', 'Fase XP');
INSERT INTO fase (fas_idfase, fas_nombrefase, fas_metodologia, fas_descripcion) VALUES (4, 'Planificacion', 'XP ', 'Fase XP');


--
-- TOC entry 1921 (class 0 OID 18359)
-- Dependencies: 1553
-- Data for Name: grupotrabajo; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO grupotrabajo (grt_idgrupotrabajo, grt_nombregrupotrabajo, grt_curso, grt_notadefinitiva) VALUES (1, 'Uno', '750805M', NULL);
INSERT INTO grupotrabajo (grt_idgrupotrabajo, grt_nombregrupotrabajo, grt_curso, grt_notadefinitiva) VALUES (3, 'vectorSoft', '750805M', NULL);
INSERT INTO grupotrabajo (grt_idgrupotrabajo, grt_nombregrupotrabajo, grt_curso, grt_notadefinitiva) VALUES (6, 'Gesoft', '750806M', NULL);


--
-- TOC entry 1922 (class 0 OID 18367)
-- Dependencies: 1555
-- Data for Name: material; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO material (idmaterial, mat_nombrematerial, mat_ruta, mat_descripcionmaterial, mat_fasematerial, mat_artefactomaterial, mat_actividad) VALUES (1, 'didacticas', 'httml', 'dss', 1, 1, 2);
INSERT INTO material (idmaterial, mat_nombrematerial, mat_ruta, mat_descripcionmaterial, mat_fasematerial, mat_artefactomaterial, mat_actividad) VALUES (2, 'metodologia', 'haaa', 'safdas', 2, 2, 2);


--
-- TOC entry 1931 (class 0 OID 18548)
-- Dependencies: 1570
-- Data for Name: metodologia; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO metodologia (met_id, met_nombre, met_descripcion) VALUES (1, 'XP', 'agil');
INSERT INTO metodologia (met_id, met_nombre, met_descripcion) VALUES (2, 'RUP', 'extensa');
INSERT INTO metodologia (met_id, met_nombre, met_descripcion) VALUES (3, 'Cristal', 'agil ');


--
-- TOC entry 1923 (class 0 OID 18378)
-- Dependencies: 1557
-- Data for Name: modulo; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- TOC entry 1924 (class 0 OID 18386)
-- Dependencies: 1559
-- Data for Name: permiso; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- TOC entry 1925 (class 0 OID 18392)
-- Dependencies: 1560
-- Data for Name: profesor; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO profesor (prf_cedulaprofesor, prf_nombreprofesor, prf_apellidoprofesor, prf_loginusuario, prf_cursoprofesor) VALUES ('1234', 'a', 'a', 'as', '750805M');
INSERT INTO profesor (prf_cedulaprofesor, prf_nombreprofesor, prf_apellidoprofesor, prf_loginusuario, prf_cursoprofesor) VALUES ('w', 'a', 'as', 'w', '750805M');


--
-- TOC entry 1926 (class 0 OID 18399)
-- Dependencies: 1562
-- Data for Name: reporteentregas; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- TOC entry 1927 (class 0 OID 18408)
-- Dependencies: 1563
-- Data for Name: reportenotas; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- TOC entry 1928 (class 0 OID 18418)
-- Dependencies: 1565
-- Data for Name: roles; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- TOC entry 1929 (class 0 OID 18429)
-- Dependencies: 1567
-- Data for Name: tipousuario; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- TOC entry 1930 (class 0 OID 18435)
-- Dependencies: 1568
-- Data for Name: usuario; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO usuario (usu_loginusuario, usu_contrasenausuario, usu_tipousuario) VALUES ('jean', 'jean', 'estudiante');
INSERT INTO usuario (usu_loginusuario, usu_contrasenausuario, usu_tipousuario) VALUES ('andrea', 'andrea', 'profesor');
INSERT INTO usuario (usu_loginusuario, usu_contrasenausuario, usu_tipousuario) VALUES ('jeantech', 'jeantech', 'administrador');
INSERT INTO usuario (usu_loginusuario, usu_contrasenausuario, usu_tipousuario) VALUES ('s', 's', 'estudiante');
INSERT INTO usuario (usu_loginusuario, usu_contrasenausuario, usu_tipousuario) VALUES ('d', 'd', 'estudiante');
INSERT INTO usuario (usu_loginusuario, usu_contrasenausuario, usu_tipousuario) VALUES ('asf', 'as', 'estudiante');
INSERT INTO usuario (usu_loginusuario, usu_contrasenausuario, usu_tipousuario) VALUES ('AD', 'as', 'profesor');
INSERT INTO usuario (usu_loginusuario, usu_contrasenausuario, usu_tipousuario) VALUES ('sdf', 'adf', 'profesor');
INSERT INTO usuario (usu_loginusuario, usu_contrasenausuario, usu_tipousuario) VALUES ('w', 'w', 'profesor');
INSERT INTO usuario (usu_loginusuario, usu_contrasenausuario, usu_tipousuario) VALUES ('as', 'as', 'profesor');
INSERT INTO usuario (usu_loginusuario, usu_contrasenausuario, usu_tipousuario) VALUES ('wwwas', 'as', 'estudiante');
INSERT INTO usuario (usu_loginusuario, usu_contrasenausuario, usu_tipousuario) VALUES ('wwwasw', 'as', 'estudiante');
INSERT INTO usuario (usu_loginusuario, usu_contrasenausuario, usu_tipousuario) VALUES ('asdf12', 'as', 'estudiante');
INSERT INTO usuario (usu_loginusuario, usu_contrasenausuario, usu_tipousuario) VALUES ('asdfgh', 'as', 'estudiante');
INSERT INTO usuario (usu_loginusuario, usu_contrasenausuario, usu_tipousuario) VALUES ('12789', 's', 'estudiante');
INSERT INTO usuario (usu_loginusuario, usu_contrasenausuario, usu_tipousuario) VALUES ('1f', 's', 'estudiante');


--
-- TOC entry 1861 (class 2606 OID 18315)
-- Dependencies: 1543 1543
-- Name: actividad_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY actividad
    ADD CONSTRAINT actividad_pkey PRIMARY KEY (act_idactividad);


--
-- TOC entry 1863 (class 2606 OID 18326)
-- Dependencies: 1545 1545
-- Name: artefactos_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY artefactos
    ADD CONSTRAINT artefactos_pkey PRIMARY KEY (art_idartefacto);


--
-- TOC entry 1865 (class 2606 OID 18334)
-- Dependencies: 1547 1547
-- Name: configuracioncurso_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY configuracioncurso
    ADD CONSTRAINT configuracioncurso_pkey PRIMARY KEY (cfc_idconfiguracioncurso);


--
-- TOC entry 1867 (class 2606 OID 18339)
-- Dependencies: 1548 1548
-- Name: curso_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY curso
    ADD CONSTRAINT curso_pkey PRIMARY KEY (cur_idcurso);


--
-- TOC entry 1869 (class 2606 OID 18345)
-- Dependencies: 1549 1549
-- Name: estudiante_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY estudiante
    ADD CONSTRAINT estudiante_pkey PRIMARY KEY (est_codigoestudiante);


--
-- TOC entry 1871 (class 2606 OID 18356)
-- Dependencies: 1551 1551
-- Name: fase_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY fase
    ADD CONSTRAINT fase_pkey PRIMARY KEY (fas_idfase);


--
-- TOC entry 1873 (class 2606 OID 18364)
-- Dependencies: 1553 1553
-- Name: grupotrabajo_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY grupotrabajo
    ADD CONSTRAINT grupotrabajo_pkey PRIMARY KEY (grt_idgrupotrabajo);


--
-- TOC entry 1893 (class 2606 OID 18553)
-- Dependencies: 1570 1570
-- Name: key; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY metodologia
    ADD CONSTRAINT key PRIMARY KEY (met_id);


--
-- TOC entry 1875 (class 2606 OID 18375)
-- Dependencies: 1555 1555
-- Name: material_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY material
    ADD CONSTRAINT material_pkey PRIMARY KEY (idmaterial);


--
-- TOC entry 1877 (class 2606 OID 18383)
-- Dependencies: 1557 1557
-- Name: modulo_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY modulo
    ADD CONSTRAINT modulo_pkey PRIMARY KEY (mod_idmodulo);


--
-- TOC entry 1879 (class 2606 OID 18391)
-- Dependencies: 1559 1559
-- Name: permiso_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY permiso
    ADD CONSTRAINT permiso_pkey PRIMARY KEY (pem_idpermiso);


--
-- TOC entry 1881 (class 2606 OID 18396)
-- Dependencies: 1560 1560
-- Name: profesor_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY profesor
    ADD CONSTRAINT profesor_pkey PRIMARY KEY (prf_cedulaprofesor);


--
-- TOC entry 1883 (class 2606 OID 18407)
-- Dependencies: 1562 1562
-- Name: reporteentregas_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY reporteentregas
    ADD CONSTRAINT reporteentregas_pkey PRIMARY KEY (rpe_idreporte);


--
-- TOC entry 1885 (class 2606 OID 18415)
-- Dependencies: 1563 1563
-- Name: reportenotas_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY reportenotas
    ADD CONSTRAINT reportenotas_pkey PRIMARY KEY (rpn_idreportenotas);


--
-- TOC entry 1887 (class 2606 OID 18426)
-- Dependencies: 1565 1565
-- Name: roles_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY roles
    ADD CONSTRAINT roles_pkey PRIMARY KEY (rol_idroles);


--
-- TOC entry 1889 (class 2606 OID 18434)
-- Dependencies: 1567 1567
-- Name: tipousuario_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tipousuario
    ADD CONSTRAINT tipousuario_pkey PRIMARY KEY (tpu_id);


--
-- TOC entry 1891 (class 2606 OID 18439)
-- Dependencies: 1568 1568
-- Name: usuario_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY usuario
    ADD CONSTRAINT usuario_pkey PRIMARY KEY (usu_loginusuario);


--
-- TOC entry 1894 (class 2606 OID 18440)
-- Dependencies: 1543 1551 1870
-- Name: actividad_fk_1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY actividad
    ADD CONSTRAINT actividad_fk_1 FOREIGN KEY (act_fase) REFERENCES fase(fas_idfase) ON UPDATE CASCADE ON DELETE SET DEFAULT;


--
-- TOC entry 1895 (class 2606 OID 18445)
-- Dependencies: 1860 1545 1543
-- Name: artefactos_fk_1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY artefactos
    ADD CONSTRAINT artefactos_fk_1 FOREIGN KEY (art_actividad) REFERENCES actividad(act_idactividad) ON UPDATE CASCADE ON DELETE SET DEFAULT;


--
-- TOC entry 1896 (class 2606 OID 18450)
-- Dependencies: 1551 1547 1870
-- Name: configuracioncurso_fk_1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY configuracioncurso
    ADD CONSTRAINT configuracioncurso_fk_1 FOREIGN KEY (cfc_fase) REFERENCES fase(fas_idfase) ON UPDATE CASCADE ON DELETE SET DEFAULT;


--
-- TOC entry 1897 (class 2606 OID 18455)
-- Dependencies: 1547 1862 1545
-- Name: configuracioncurso_fk_2; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY configuracioncurso
    ADD CONSTRAINT configuracioncurso_fk_2 FOREIGN KEY (cfc_artefacto) REFERENCES artefactos(art_idartefacto) ON UPDATE CASCADE ON DELETE SET DEFAULT;


--
-- TOC entry 1898 (class 2606 OID 18460)
-- Dependencies: 1547 1860 1543
-- Name: configuracioncurso_fk_3; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY configuracioncurso
    ADD CONSTRAINT configuracioncurso_fk_3 FOREIGN KEY (cfc_actividad) REFERENCES actividad(act_idactividad) ON UPDATE CASCADE ON DELETE SET DEFAULT;


--
-- TOC entry 1899 (class 2606 OID 18465)
-- Dependencies: 1866 1548 1547
-- Name: configuracioncurso_fk_4; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY configuracioncurso
    ADD CONSTRAINT configuracioncurso_fk_4 FOREIGN KEY (cfc_curso) REFERENCES curso(cur_idcurso) ON UPDATE CASCADE ON DELETE SET DEFAULT;


--
-- TOC entry 1900 (class 2606 OID 18470)
-- Dependencies: 1872 1549 1553
-- Name: estudiante_fk_1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY estudiante
    ADD CONSTRAINT estudiante_fk_1 FOREIGN KEY (est_grupotrabajo) REFERENCES grupotrabajo(grt_idgrupotrabajo) ON UPDATE CASCADE ON DELETE SET DEFAULT;


--
-- TOC entry 1901 (class 2606 OID 18475)
-- Dependencies: 1568 1890 1549
-- Name: estudiante_fk_2; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY estudiante
    ADD CONSTRAINT estudiante_fk_2 FOREIGN KEY (est_loginusuario) REFERENCES usuario(usu_loginusuario) ON UPDATE CASCADE ON DELETE SET DEFAULT;


--
-- TOC entry 1902 (class 2606 OID 18480)
-- Dependencies: 1866 1549 1548
-- Name: estudiante_fk_3; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY estudiante
    ADD CONSTRAINT estudiante_fk_3 FOREIGN KEY (est_cursoestudiante) REFERENCES curso(cur_idcurso) ON UPDATE CASCADE ON DELETE SET DEFAULT;


--
-- TOC entry 1903 (class 2606 OID 18485)
-- Dependencies: 1866 1548 1553
-- Name: grupotrabajo_fk_1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY grupotrabajo
    ADD CONSTRAINT grupotrabajo_fk_1 FOREIGN KEY (grt_curso) REFERENCES curso(cur_idcurso) ON UPDATE CASCADE ON DELETE SET DEFAULT;


--
-- TOC entry 1904 (class 2606 OID 18490)
-- Dependencies: 1555 1870 1551
-- Name: material_fk_1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY material
    ADD CONSTRAINT material_fk_1 FOREIGN KEY (mat_fasematerial) REFERENCES fase(fas_idfase) ON UPDATE CASCADE ON DELETE SET DEFAULT;


--
-- TOC entry 1905 (class 2606 OID 18495)
-- Dependencies: 1862 1545 1555
-- Name: material_fk_2; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY material
    ADD CONSTRAINT material_fk_2 FOREIGN KEY (mat_artefactomaterial) REFERENCES artefactos(art_idartefacto) ON UPDATE CASCADE ON DELETE SET DEFAULT;


--
-- TOC entry 1906 (class 2606 OID 18500)
-- Dependencies: 1555 1860 1543
-- Name: material_fk_3; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY material
    ADD CONSTRAINT material_fk_3 FOREIGN KEY (mat_actividad) REFERENCES actividad(act_idactividad) ON UPDATE CASCADE ON DELETE SET DEFAULT;


--
-- TOC entry 1907 (class 2606 OID 18505)
-- Dependencies: 1559 1876 1557
-- Name: permiso_fk_1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY permiso
    ADD CONSTRAINT permiso_fk_1 FOREIGN KEY (pem_modulo) REFERENCES modulo(mod_idmodulo) ON UPDATE CASCADE ON DELETE SET DEFAULT;


--
-- TOC entry 1908 (class 2606 OID 18510)
-- Dependencies: 1890 1568 1560
-- Name: profesor_fk_1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY profesor
    ADD CONSTRAINT profesor_fk_1 FOREIGN KEY (prf_loginusuario) REFERENCES usuario(usu_loginusuario) ON UPDATE CASCADE ON DELETE SET DEFAULT;


--
-- TOC entry 1909 (class 2606 OID 18515)
-- Dependencies: 1866 1548 1560
-- Name: profesor_fk_2; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY profesor
    ADD CONSTRAINT profesor_fk_2 FOREIGN KEY (prf_cursoprofesor) REFERENCES curso(cur_idcurso) ON UPDATE CASCADE ON DELETE SET DEFAULT;


--
-- TOC entry 1910 (class 2606 OID 18520)
-- Dependencies: 1553 1562 1872
-- Name: reporteentregas_fk_1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY reporteentregas
    ADD CONSTRAINT reporteentregas_fk_1 FOREIGN KEY (rpe_grupotrabajo) REFERENCES grupotrabajo(grt_idgrupotrabajo) ON UPDATE CASCADE ON DELETE SET DEFAULT;


--
-- TOC entry 1911 (class 2606 OID 18525)
-- Dependencies: 1543 1860 1562
-- Name: reporteentregas_fk_2; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY reporteentregas
    ADD CONSTRAINT reporteentregas_fk_2 FOREIGN KEY (rpe_actividad) REFERENCES actividad(act_idactividad) ON UPDATE CASCADE ON DELETE SET DEFAULT;


--
-- TOC entry 1912 (class 2606 OID 18530)
-- Dependencies: 1560 1563 1880
-- Name: reportenotas_fk_1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY reportenotas
    ADD CONSTRAINT reportenotas_fk_1 FOREIGN KEY (rpn_profesor) REFERENCES profesor(prf_cedulaprofesor) ON UPDATE CASCADE ON DELETE SET DEFAULT;


--
-- TOC entry 1913 (class 2606 OID 18535)
-- Dependencies: 1563 1872 1553
-- Name: reportenotas_fk_2; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY reportenotas
    ADD CONSTRAINT reportenotas_fk_2 FOREIGN KEY (rpn_grupotrabajo) REFERENCES grupotrabajo(grt_idgrupotrabajo) ON UPDATE CASCADE ON DELETE SET DEFAULT;


--
-- TOC entry 1914 (class 2606 OID 18540)
-- Dependencies: 1562 1882 1563
-- Name: reportenotas_fk_3; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY reportenotas
    ADD CONSTRAINT reportenotas_fk_3 FOREIGN KEY (reporteentrega) REFERENCES reporteentregas(rpe_idreporte) ON UPDATE CASCADE ON DELETE SET DEFAULT;


--
-- TOC entry 1936 (class 0 OID 0)
-- Dependencies: 3
-- Name: public; Type: ACL; Schema: -; Owner: postgres
--

REVOKE ALL ON SCHEMA public FROM PUBLIC;
REVOKE ALL ON SCHEMA public FROM postgres;
GRANT ALL ON SCHEMA public TO postgres;
GRANT ALL ON SCHEMA public TO PUBLIC;


-- Completed on 2010-06-01 01:24:53

--
-- PostgreSQL database dump complete
--

